/*
 * Flashbox4SettingView.cpp
 *
 *  Created on: 2009-1-20
 *      Author: hequn
 */
#include  <aknviewappui.h>

#include "Flashbox4SettingView.h"
#include "Flashbox4.hrh"



CFlashbox4SettingView::~CFlashbox4SettingView()
{
	if (m_pSettingContainer != NULL)
	{
		delete m_pSettingContainer;
		m_pSettingContainer = NULL;
	}
}

void CFlashbox4SettingView::ConstructL()
{
	//调用基类构造函数
	BaseConstructL();
}

TUid CFlashbox4SettingView::Id() const
{
	return TUid::Uid(ESettingViewId);
}

void CFlashbox4SettingView::HandleClientRectChange()
{
	if(m_pSettingContainer)
	{
		m_pSettingContainer->SetExtentToWholeScreen();
	}
}

void CFlashbox4SettingView::DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
		const TDesC8& aCustomMessage)
{
	if (m_pSettingContainer == NULL)
	{
		m_pSettingContainer = new (ELeave) CFlashbox4SettingContainer;
		m_pSettingContainer->SetMopParent (this);
		m_pSettingContainer->ConstructL ( ClientRect ( ) , aPrevViewId.iViewUid, aCustomMessageId.iUid);
		m_pSettingContainer->SetExtentToWholeScreen();
		AppUi()->AddToStackL (*this, m_pSettingContainer);
	} 
}

void CFlashbox4SettingView::DoDeactivate()
{
	if ( m_pSettingContainer != NULL)
	{
		AppUi()->RemoveFromViewStack ( *this, m_pSettingContainer );
		delete m_pSettingContainer;
		m_pSettingContainer = NULL;
	}
}
